{% load comments %}

<div class="media">
    {% block post_author_mugshot %}
        <a class="media-left" href="{{ post.author.get_absolute_url }}">
            <img class="media-object" src="{{ post.author.mugshot_thumbnail.url }}"
                 alt="" style="width: 3em;">
        </a>
    {% endblock post_author_mugshot %}
    <div class="media-body post-item">
        <h6 class="media-heading font-weight-bold"><a href="{{ post.get_absolute_url }}">
            {% if post.pinned %}
                <span style="color: red">[置顶]</span>{% endif %} {{ post.title }}</a>
        </h6>
        <ul class="list-inline text-muted small">
            {% block category %}
                <li class="list-inline-item"><a href="{% url 'categories:posts' post.category.slug %}"
                                                class="tag tag-default">{{ post.category }}</a>
                </li>
            {% endblock category %}
            <li class="list-inline-item"><a
                    href="{{ post.author.get_absolute_url }}"
                    class="nickname"><strong>{{ post.author.nickname }}</strong></a>
            </li>
            {% if post.latest_reply %}
                <li class="list-inline-item">
                    <time>{{ post.latest_reply.submit_date|timesince }}前</time>
                </li>
                <li class="list-inline-item">最后回复来自 <a class="nickname"
                                                       href="{{ post.latest_reply.user.get_absolute_url }}"><strong>{{ post.latest_reply.user.nickname }}</strong></a>
                </li>
            {% endif %}
            {% if post.views %}
                <li class="list-inline-item">{{ post.views }} 次点击
                </li>
            {% endif %}
        </ul>
    </div>
    {% get_comment_count for post as reply_count %}
    {% if reply_count %}
        <div class="media-right media-middle">
            <a href="{{ post.get_absolute_url }}"
               class="tag tag-default tag-pill">{{ reply_count }}</a>
        </div>
    {% endif %}
</div>